from sklearn import decomposition
import pandas as pd

if __name__ == "__main__":
    data_user = pd.read_csv("data1.txt")
    data_price = pd.read_csv("data2.txt")
    data_merge = pd.merge(data_user, data_price, on=["buy_id"])  # 表格合并
    print(data_merge)
    data_crosstab = pd.crosstab(data_merge["id"], data_merge["buy_id"])  # 交叉表
    print(data_crosstab)
